package leetcode;

public class SumNums {
    public static void main(String[] args) {
        SumNums sumNums = new SumNums();
        System.out.println(sumNums.sumNums(9));
    }

    public int sumNums(int n) {
        if (n == 1) {
            return 1;
        }
        return n + sumNums(n - 1);
    }
}
